<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%@taglib prefix="wetechfn" uri="/WEB-INF/tlds/wetech-functions.tld" %>--%>
<%@taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="shiro" uri="/WEB-INF/tlds/shiros.tld" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!-- Content Header (Page header) -->
<section class="content-header" style="">
    <h1>
        档案库管理
        <small>系统用户管理页面</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="#">档案库管理</a></li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <table id="table"></table>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
    <!-- /.col -->
    </div>
    <!-- /.row -->
</section>
<!-- /.content -->


<script>
    var $table = $('#table');

    $(function () {
        // bootstrap table初始化
        // http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/
        $table.bootstrapTable({
            url: path + '/user/findByUserType',
            idField: 'id',
            searchOnEnterKey: true,
            showColumns: false,
            detailView: false,
            search: false,
            /*queryParams: Search,*/
            striped: true,
            columns: [
                {field: 'id', title: '编号'},
                {field: 'reallyName', title: '姓名'},
                {field: 'phone', title: '手机号'},
                {field: 'organizationName', title: '业务组'},
                {field: 'pName', title: '组长'},
                {
                    field: 'action',
                    title: '操作',
                    halign: 'center',
                    align: 'center',
                    formatter: 'actionFormatter',
                    events: 'actionEvents',
                    clickToSelect: false
                }
            ]
        });
    });

    function actionFormatter(value, row, index) {
        return '\
        <button id="detail" >查看档案库</button>　\
        ';
    }

    window.actionEvents = {
        'click #detail': function (e, value, row, index) {
            var id = row.id
            $.myAdmin.loadContent('#archives/findByOperateIDView?id=' + id + '');
        }
    }

</script>